//
//  QDSicknessCaseCell.m
//  simulateQuickDoctor
//
//  Created by locklight on 17/3/26.
//  Copyright © 2017年 PipiXia. All rights reserved.
//

#import "QDSicknessCaseCell.h"

@interface QDSicknessCaseCell ()

/**
 *  时间label
 */
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

/**
 *  病例图片imageView
 */
@property (weak, nonatomic) IBOutlet UIImageView *casePicture;

/**
 *  病例类型label
 */
@property (weak, nonatomic) IBOutlet UILabel *caseLabel;

/**
 *  病例描述label
 */
@property (weak, nonatomic) IBOutlet UILabel *descLabel;

@end

@implementation QDSicknessCaseCell

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super initWithCoder:aDecoder]) {
        self.backgroundColor = [UIColor groupTableViewBackgroundColor];
        UIView *view = [[UIView alloc] init];
        view.backgroundColor = PPColor;
        self.selectedBackgroundView = view;
    }
    return self;
}

- (void)setCaseModel:(QDSickCaseModel *)caseModel {
    _caseModel = caseModel;
    
    self.timeLabel.text = caseModel.time;
    
    UIImage *image;
    if (caseModel.picArray.count == 1 || caseModel.picArray == nil) {
        image = [UIImage imageNamed:@"patient_defaultphoto_male"];
    }else{
        image= caseModel.picArray[0];
    }
    // 病例图片
    self.casePicture.image = image;
    // 病例类型
    self.caseLabel.text = caseModel.caseCatogory;
    // 病例描述
    self.descLabel.text = caseModel.illnessDescription;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
